/**
 * 活动规则
 */
import request from '@/utils/request'

/**
 * 获取规则列表
 * @param {*} params 
 */
export function activityRules(params = {}) {
  return request({
    url: '/basic/data/activityRule/list',
    method: 'get',
    params: params
  })
}

/**
 * 新增活动规则
 * @param {*} params 
 */
export function activityRuleAdd(params = {}) {
  return request({
    url: '/basic/data/activityRule/add',
    method: 'post',
    data: params
  })
}

/**
 * 修改活动规则
 * @param {*} params 
 * @returns 
 */
export function activityRuleEdit(params = {}) {
  return request({
    url: '/basic/data/activityRule/edit',
    method: 'post',
    data: params
  })
}

/**
 * 获取活动规则详情
 * @param {*} params 
 */
export function activityRuleDetail(params = {}) {
  let url = '/basic/data/activityRule/getInfo/' + params.id;
  return request({
    url: url,
    method: 'get',
    // params: params
  })
}

/**
 * 查询已启用规则的客户类型
 * @param {*} params 
 */
export function getSelectedCustomerType(params = {}) {
  let url = '/basic/data/activityRule/getSelectedCustomerType';
  return request({
    url: url,
    method: 'get',
    params: params
  })
}